package com.lx.oms.controller.service.impl;

import java.math.BigInteger;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lx.oms.common.entity.Page;
import com.lx.oms.common.entity.Query;
import com.lx.oms.common.entity.R;
import com.lx.oms.common.utils.CommonUtils;
import com.lx.oms.controller.entity.QuotationTrendEntity;
import com.lx.oms.controller.manager.QuotationTrendManager;
import com.lx.oms.controller.service.QuotationTrendService;

/**
 * 行情走势
 *
 * @author houzhong
 * @date 2018年7月16日 下午2:35:20
 */
@Service("quotationTrendService")
public class QuotationTrendServiceImpl implements QuotationTrendService {

	@Autowired
	private QuotationTrendManager quotationTrendManager;

	@Override
	public Page<QuotationTrendEntity> listQuotationTrend(Map<String, Object> params) {
		Query query = new Query(params);
		Page<QuotationTrendEntity> page = new Page<>(query);
		quotationTrendManager.listQuotationTrend(page, query);
		return page;
	}

	@Override
	public R saveQuotationTrend(QuotationTrendEntity quotationTrend) {
		int count = quotationTrendManager.saveQuotationTrend(quotationTrend);
		return CommonUtils.msg(count);
	}

	@Override
	public R getQuotationTrendById(BigInteger id) {
		QuotationTrendEntity quotationTrend = quotationTrendManager.getQuotationTrendById(id);
		return CommonUtils.msg(quotationTrend);
	}

	@Override
	public R updateQuotationTrend(QuotationTrendEntity quotationTrend) {
		int count = quotationTrendManager.updateQuotationTrend(quotationTrend);
		return CommonUtils.msg(count);
	}

	@Override
	public R batchRemove(String[] id) {
		int count = quotationTrendManager.batchRemove(id);
		return CommonUtils.msg(id, count);
	}

}
